home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************************
- Test.c
-
- Created: Sunday, July 25, 1993, 11:16 PM
- Project: CommAnalyzer.π
- Compiler: 6.0, © Symantec Corporation 1993
- By: Greg Ames
-
- Copyright © 1993,1993 Ames & Associates.
- All rights reserved.
-
- AppleLink:AMES
- AOL:AMES
- Compuserve:73177,1603
-
- ***********************************************************************/
- #include <Serial.h>
- #include <StdLib.h>
-
- #define baud38400 1
-
- char buffer[] = "\p#ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ#";
- /****
- * InitMacintosh()
- *
- * Initialize all the managers & memory
- *
- ****/
-
- void InitMacintosh(void);
- void InitMacintosh(void)
-
- {
- MaxApplZone();
-
- InitGraf(&thePort);
- InitFonts();
- FlushEvents(everyEvent, 0);
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(0L);
- InitCursor();
-
- }
- /* end InitMacintosh */
-
- short ain,aout;
- void closeSerial(void);
-
- void
- main( void)
-
- {
- short err;
- long count;
-
- InitMacintosh();
-
- err = OpenDriver("\p.aout",&aout);
-
- err = OpenDriver("\p.ain",&ain);
-
- err = SerReset(aout,baud38400+stop10+noParity+data8);
- // err = SerReset(aout,baud19200+stop10+noParity+data8);
-
- _atexit(closeSerial);
- count = buffer[0];
- do {
- err = FSWrite(aout,&count,&buffer[1]);
- } while (!Button());
-
- }
- /* end main */
-
- void closeSerial()
- {
- short err;
-
- err = CloseDriver(ain);
- err = CloseDriver(aout);
- }